<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<%@ include file="/public/head.jspf" %>
	<style type="text/css">
		form div {
			margin:10px;
		}
	</style>
	<script type="text/javascript">
		$(function(){
		
			/* 	
			$("input[name=name]").validatebox({
				required:true,
				missingMessage:'请输入商品名称'
			});

			$("input[name=price]").numberbox({
				required:true,
				missingMessage:'请输入商品价格',
				min:0,
				precision:2, //保留两位小数
				prefix:'$'
			});
			$("input[name='fileImage.upload']").validatebox({
				required:true,
				missingMessage:'请上传商品图片',
				//设置自定义方法
				validType:"format['gif,jpg,jpeg,png']"//中括号里面是参数
			});
	
			$("textarea[name=mark]").validatebox({
				required:true,
				missingMessage:'请输入商品的简单描述'
			}); */
			
			
			
			
			//注册button的事件
			$("#submit").click(function(){
				//开启验证
				//如果验证成功，则提交数据
					//调用submit方法提交数据
					$("#ff").form('submit', {
						url: 'foodMrgAction_save.action?sellerid=${session.loginMrg.sellerid}',
						success: function(){
							//如果成功了，关闭当前窗口
							parent.$("#win").window("close");
							parent.$("iframe[title='添加菜式']").get(0).contentWindow.$("#dg").datagrid("reload");
						}
					});
			});
			
			//注册button的事件
			$("#reset").click(function(){
				//重置当前表单数据
				$("#ff").form("reset");
			});
		});
	</script>
  </head>
  
  <body>
	  <form title="添加商品" id="ff" method="post" enctype="multipart/form-data">
		<div>
			<label>商品名称:</label> <input type="text" id="foodname" name="foodname" />
		</div>

		<div>
			<label>商品价格:</label> <input type="text" id="price" name="price" />
		</div>
		<div>
			<label>图片上传:</label> <input type="file" name="fileImage.upload" />
		</div>

		
		 
		<div>
			<label>简单描述:</label>
			<input type="text" id="mark" name="mark" />
		</div>
		<div>
			<a id="submit" href="#" class="easyui-linkbutton">添 加</a> 
<!-- 			<a id="reset" href="#" class="easyui-linkbutton">重 置</a>
 -->		</div>
	  </form>	
  </body>
</html>